<!DOCTYPE HTML>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="keywords" content="富文本,富文本编辑器,富文本框,在线编辑器,html,javascript, typescript,rich editor">
    <meta name="Description" content="wangEditor - 轻量级 web 富文本编辑器">
    <title>wangEditor - 轻量级 web 富文本编辑器</title>

    <link rel="stylesheet" type="text/css" href="css/boostrap.min.css">
    <link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
    <!--[if IE]>
    <link rel="stylesheet" type="text/css" href="/css/font-awesome-ie7.min.css">
    <![endif]-->
    <!-- <link rel="stylesheet" type="text/css" href="css/common.css"> 
    <link rel="stylesheet" type="text/css" href="css/index.css">-->
    <link rel="shortcut icon" href="favicon.ico" />
</head>

<body>
    <div id="div-demo" style="margin-top:100px;"></div>
    <button onclick="submit()"> 提交</button>
    <script type="text/javascript" src='js/jquery-1.10.2.min.js'></script>
    <script type="text/javascript" src='js/boostrap.min.js'></script>
    <script src="js/base64.js"></script>
    <script type="text/javascript" src='js/wangEditor.min.js'></script>
    <script>
        var editor = null;
        $(function () {
            var E = window.wangEditor
            editor = new E('#div-demo')
            editor.config.uploadImgShowBase64 = true
            editor.config.height = 800
            console.log(editor.config)
            editor.config.lang="UTF-8"
            editor.config.placeholder = '请输入内容'
            editor.create()
        });

        function submit() {            
            // 解决传给后端的中文乱码
            $.base64.utf8encode = true;
            // 要提交给后端的文本
            console.log($.base64.btoa(editor.txt.html()))
            // 显示$.base64.atob(content,true)
        }
    </script>

</body>

</html>